Fix: Remove extraneous JSON preamble from LLM responses#10957
Fix: Remove extraneous JSON preamble from LLM responses#10957sto-j wants to merge 1 commit intonextcloud:mainfrom
Conversation
The most of the LLM's return in JSON markdown format, example:
```json
{
"reply1": "Received, thanks...",
"reply2": "Thanks for forwarding this..."
}
```
Adding additional instructions did't help.
This is solution to strip:
```json
```
from the answer.
Signed-off-by: sto-j <162719726+sto-j@users.noreply.github.com>
|
Thanks for opening your first pull request in this repository! ✌️ |
|
@sto-j would you be interested in writing a test to cover the case? If so, please update your branch, with a merge or a rebase, and add at least one test method where the LLM service returns a response with the specific preamble. We can write the test as well. Just let us know what you prefer :) |
@ChristophWurst I'm sorry, my schedule is full this month, the rest of this pull request is in your hands. |
|
No problem at all. We'll take over 🫡 Thanks a lot for the contributions :) |
|
Superseded by #10966 |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
The most of the LLM's return in JSON markdown format, example:
```json
{
"reply1": "Received, thanks...",
"reply2": "Thanks for forwarding this..."
}
```
Adding additional instructions didn't help.
This is solution to strip:
```json
```
from the answer.